import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:potato_music_app/router/routes.dart';

class Application {

  static Router router;

  static void goToPage(
    BuildContext context, path, 
    {
      bool replace: false, 
      bool clearStack: false, 
      Duration transitionDuration: const Duration(milliseconds: 250),
      RouteTransitionsBuilder transitionBuilder
    }
  ) {
    router.navigateTo(
      context, 
      path, 
      replace: replace, 
      clearStack: clearStack,
      transitionDuration: transitionDuration,
      transitionBuilder: transitionBuilder,
      transition: TransitionType.material
    );
  }

  static void goToLoginPage(BuildContext context) {
    goToPage(context, Routes.login, clearStack: true);
  }

  static void goToTabbarPage(BuildContext context) {
    goToPage(context, Routes.tabbar, clearStack: true);
  }
}